********************************************************************************
* Purpose: Imams data analysis - scaleup Eid ul Azha 2020 
* Sub-file: Balance 
********************************************************************************

	****************************************************************************
	* Load data
	****************************************************************************

	use			"${imamsurvey}/merged_scaleup.dta" , clear 
	
	keep		if consent_statement==1	& respond_ms==1							// Main analysis sample (Sample 1): responded to baseline & MS 

	
	****************************************************************************
	* Table
	****************************************************************************
					
	reg			treatment_any $balance , robust 
	local 		p1 = round( Ftail(e(df_m), e(df_r), e(F)) , .01)
	
	reg			treatment_secular $balance , robust 
	local 		p2 = round( Ftail(e(df_m), e(df_r), e(F)) , .01) 
		
	
	iebaltab	$balance , ///
					grpvar(treatment_scaleup) ///
					savetex("${texrct}/scaleup_balance.tex") replace ///
					vce(robust) rowvarlabels ///
					tblnote("P-values of F-test for joint significance of all variables in predicting assignment to any treatment: `p1' ; Secular only arm: `p2'." ///
					"Notes: Sample sizes for covariates vary because of non-response to baseline questions due to some respondents hanging up before completing the baseline call.")

					
	